﻿using FigureDraw.Diagram;
using FigureDraw.Graphic;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace FigureDraw
{
    public abstract class MyShape
    {
        protected MyPoint startPoint;
        protected MyPoint endPoint;       
        protected MyColorInfo brushColor;
        protected MyColorInfo strokeColor;
        protected double strokeWidth;


        public MyPoint StartPoint
        {
            get { return startPoint; }
            set { startPoint = value; }
        }

        public MyPoint EndPoint
        {
            get { return endPoint; }
            set { endPoint = value; }
        }

        public MyColorInfo BrushColor
        {
            get { return brushColor; }
            set { brushColor = value; }
        }

        public MyColorInfo StrokeColor
        {
            get { return strokeColor; }
            set { strokeColor = value; }
        }

        public double StrokeWidth
        {
            get { return strokeWidth; }
            set { strokeWidth = value; }
        }

        public MyShape()
        {
            DefaultInit();
            this.startPoint = new MyPoint(0, 0);
            this.endPoint = new MyPoint(0, 0);
        }

        public MyShape(MyPoint startPoint, MyPoint endPoint)
        {
            DefaultInit();
            this.startPoint = startPoint;
            this.endPoint = endPoint;
        }

        public abstract void Draw(CommonGraphic graphic);
        public abstract MyShape Clone(BlockDiagram diagram);
        public abstract MyShape Clone();

        public virtual MyShape DetachEffect()
        {
            return this;
        }

        private void DefaultInit()
        {          
            this.strokeColor = new MyColorInfo(0, 0, 0);
            this.strokeWidth = 1.0;
            this.brushColor = null;
        }
    }
}
